<?php /*a:1:{s:98:"/Users/juyaobin/Desktop/Site/app/serverLocalhost/view/ClassifiedAndTags/Classified/Classified.html";i:1596980994;}*/ ?>
<!DOCTYPE html>
<html class="iframe-h">

<head>
	<meta charset="UTF-8">
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport"
		content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<title>网站后台管理模版</title>
	<link rel="stylesheet" type="text/css" href="/public/static/admin/layui/css/layui.css" />
	<link rel="stylesheet" type="text/css" href="/public/static/admin/css/admin.css" />
	<meta name="referrer" content="no-referrer" /><!-- 头部403 -->
	<script src="/public/static/admin/js/jquery.js"></script>
	<script src="/public/static/button.js" type="text/javascript" charset="utf-8"> </script>
	<style>
		body .layer-test {
			background: none;
			box-shadow: none;
		}

		/* 定制化 */
		html .layui-layer-demo {
			background-color: #eee;
		}

		.layui-layer-demo .layui-layer-title {
			border: none;
			background-color: #333;
			color: #fff;
		}

		.long-hidde {
			/* 超出隐藏 */
			width: 20%;
			/* 要显示文字的宽度 */
			float: left;
			/* 左对齐，不设置的话只在IE下好用 */
			overflow: hidden;
			/* 超出的部分隐藏起来 */
			white-space: nowrap;
			/* 不显示的地方用省略号...代替 */
			text-overflow: ellipsis;
			/* 支持 IE */
			-o-text-overflow: ellipsis;
			/* 支持 Opera */
		}
	</style>
	<script src="/public/static/admin/js/layer/layer.js"></script>
</head>

<body>
	<div class="wrap-container clearfix">
		<div class="column-content-detail">
			<div class="layui-form" id="table-list">
				<table class="layui-table" lay-even lay-skin="nob">
					<colgroup>
						<col width="50">
						<col class="hidden-xs" style="max-width: 70;">
						<col class="hidden-xs" style="max-width: 100;">
						<col>
						<col class="hidden-xs" style="max-width: 150;">
						<col class="hidden-xs" style="max-width: 150;">
						<col class="hidden-xs" style="max-width: 150;">
						<col class="hidden-xs" style="max-width: 150;">
						<col style="max-width: 80;">
						<col style="max-width: 170;">
					</colgroup>
					<thead>
						<tr>
							<th style="text-align:center;" class="hidden-xs">封面</th>
							<th style="text-align:center;">分类名</th>
							<th style="text-align:center;" class="hidden-xs">是否是网页</th>
							<th style="text-align:center;" class="hidden-xs">是否置顶</th>
							<th style="text-align:center;" class="hidden-xs">网页链接</th>
							<th style="text-align:center;" class="hidden-xs">描述</th>
							<th style="text-align:center;" class="hidden-xs">标识符</th>
							<th style="text-align:center;">是否启用</th>
							<th style="text-align:center;" class="hidden-xs">发布人</th>
							<th style="text-align:center;">操作</th>
						</tr>
					</thead>
					<tbody name='classifiedList'>
						<?php if(is_array($classifiedList) || $classifiedList instanceof \think\Collection || $classifiedList instanceof \think\Paginator): $i = 0; $__LIST__ = $classifiedList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$classifiedListValue): $mod = ($i % 2 );++$i;if($classifiedListValue['state'] == 0): ?>
						<tr style="background-color: rgb(255, 0, 247);" data-title="<?php echo htmlentities($classifiedListValue['title']); ?>"
							data-class-id="<?php echo htmlentities($classifiedListValue['_id']); ?>" data-id="<?php echo htmlentities($classifiedListValue['data_base_id']); ?>">
							<?php else: ?>
						<tr data-title="<?php echo htmlentities($classifiedListValue['title']); ?>" data-class-id="<?php echo htmlentities($classifiedListValue['_id']); ?>"
							data-id="<?php echo htmlentities($classifiedListValue['data_base_id']); ?>">
							<?php endif; ?>

							<td class="hidden-xs">
								<img width="150"
									src="<?php echo htmlentities($springboard); ?><?php echo htmlentities($classifiedListValue['file_server']); ?><?php echo htmlentities($classifiedListValue['path']); ?>">
							</td>
							<td><?php echo htmlentities($classifiedListValue['title']); ?></td>
							<td class="hidden-xs">
								<?php if($classifiedListValue['is_web'] ==1): ?>
								是
								<?php else: ?>
								否
								<?php endif; ?>
							</td>
							<td class="hidden-xs">
								<?php if($classifiedListValue['active'] ==1): ?>
								是
								<?php else: ?>
								否
								<?php endif; ?>
							</td>
							<?php if($classifiedListValue['link']): ?>
							<td class="hidden-xs" class="hidden-xs" title="<?php echo htmlentities($classifiedListValue['link']); ?>">鼠标悬浮查看</td>
							<?php else: ?>
							<td class="hidden-xs" class="hidden-xs" title="<?php echo htmlentities($classifiedListValue['link']); ?>">未设置</td>
							<?php endif; ?>
							</td>
							<td class="hidden-xs" style="width: 20%;">
								<p style="text-align: center;">
									<?php if($classifiedListValue['description']): ?>
									<?php echo htmlentities($classifiedListValue['description']); else: ?>
									未设置
									<?php endif; ?>
								</p>
							<td class="hidden-xs">
								<p style="text-align: center;"><?php echo htmlentities($classifiedListValue['_id']); ?></p>
							</td>
							<td>
								<?php if($classifiedListValue['enable'] ==1): ?>
								<button class="layui-btn layui-btn-mini layui-btn-normal button-state">启用</button>
								<?php else: ?>
								<button class="layui-btn layui-btn-mini layui-btn-danger button-state">禁用</button>
								<?php endif; ?>
							</td>
							<td class="hidden-xs"><?php echo htmlentities($classifiedListValue['creator']); ?></td>
							<td>
								<div class="layui-inline" data-title="<?php echo htmlentities($classifiedListValue['title']); ?>">
									<button title="编辑分类信息"
										class="layui-btn layui-btn-small layui-btn-normal edit-class-info">
										<i class="layui-icon">&#xe642;</i>
									</button>
									<?php if($classifiedListValue['state'] == 0): ?>
									<button title="恢复"
										class="layui-btn layui-btn-small layui-btn-danger button-delete-class">
										<i class="iconfont">&#xe60d;</i>
									</button>
									<?php else: ?>
									<button title="删除"
										class="layui-btn layui-btn-small layui-btn-danger button-delete-class">
										<i class="layui-icon">&#xe640;</i>
									</button>
									<?php endif; if($classifiedListValue['state'] == 0): ?>
									<button title="永久删除"
										class="layui-btn layui-btn-small layui-btn-danger button-enter-delete-class">
										<i class="layui-icon">&#xe640;</i>
									</button>
									<?php else: ?>

									<?php endif; ?>


								</div>
							</td>
						</tr>
						<?php endforeach; endif; else: echo "" ;endif; ?>
					</tbody>
				</table>
			</div>
		</div>
	</div>
	<script src="/public/static/admin/layui/layui.js" type="text/javascript" charset="utf-8"></script>
	<script src="/public/static/admin/js/common.js" type="text/javascript" charset="utf-8"></script>
	<script src="/public/static/admin/js/main.js" type="text/javascript" charset="utf-8"></script>
	<script>
		var token = "<?php echo htmlentities($hashHmac_toKen); ?>";
		var controller = "<?php echo htmlentities($url); ?>serverLocalhost/"; //当前控制器路径
	</script>
	<script>
		$(document).on("click", "button.button-state", function () { //删除漫画
			var title = $(this).parent().parent().attr('data-title');
			var class_id = $(this).parent().parent().attr('data-class-id');
			var id = $(this).parent().parent().attr('data-id');
			var me = $(this);
			$.ajax({
				type: "post",
				url: controller + "Classified/updateState?class_id=" + class_id,
				data: {
					"title": title,
					"id": id,
					"token": token,
				},
				dataType: "json",
				success: function (response) {
					if (response.code == 200) {
						layer.open({
							type: 0,
							skin: 'layui-layer-demo', //样式类名
							title: "操作成功",
							closeBtn: 0, //不显示关闭按钮
							anim: 2,
							maxWidth: '50%',
							maxHeight: '50%',
							shadeClose: false, //开启遮罩关闭
							content: '<div style="max-width:100%">' +
								'<li style="text-align:center;" class="layer-area">' +
								'<div style="text-align:center;">' +
								'<img  draggable="false" style="max-Width:70%;max-height:60%;" src="https://i0.hdslb.com/bfs/album/481b5ceef0d56aa329652b269f5a02f447503e7b.png">' +
								'<div style="text-align:center;">' +
								'<font>操作成功</font>' +
								'</div>' +
								'</div>' +
								'</li>' +
								'</div>',
							btn: ['确认',] //可以无限个按钮
							,
							btn1: function (index, layero) {
								if (response.data.enable) {
									me.html('启用')
									me.addClass('layui-btn-normal');
									me.removeClass('layui-btn-danger');

								} else {
									me.html('禁用')
									me.removeClass('layui-btn-normal');
									me.addClass('layui-btn-danger');

								}

								layer.close(index);
							}
						});
					} else {
						layer.open({
							type: 0,
							skin: 'layui-layer-demo', //样式类名
							title: "发生意外错误",
							closeBtn: 0, //不显示关闭按钮
							anim: 2,
							maxWidth: '50%',
							maxHeight: '50%',
							area: ['25%', '60%'],
							shadeClose: false, //开启遮罩关闭
							content: '<div style="max-width:100%">' +
								'<li style="text-align:center;" class="layer-area">' +
								'<div style="text-align:center;">' +
								'<img  draggable="false" style="max-Width:70%;max-height:60%;" src="https://i0.hdslb.com/bfs/album/89f61ba7b2456dfd5af4bd92b485553274f73ad4.png">' +
								'<div style="text-align:center;">' +
								'<font>' + response.error + '</font>' +
								'</div>' +
								'</div>' +
								'</li>' +
								'</div>',
							btn: ['确认',] //可以无限个按钮
							,
							btn1: function (index, layero) {
								window.location.reload();
							}
						});
					}
				}
			});
		})
		$(document).on("click", "button.button-delete-class", function () { //删除漫画
			var title = $(this).parent().parent().parent().attr('data-title');
			var class_id = $(this).parent().parent().parent().attr('data-class-id');
			var id = $(this).parent().parent().parent().attr('data-id');
			var me = $(this);
			$.ajax({
				type: "post",
				url: controller + "Classified/deleteAndRecoveryClass?class_id=" + class_id,
				data: {
					"title": title,
					"id": id,
					"token": token,
				},
				dataType: "json",
				success: function (response) {
					if (response.code == 200) {
						layer.open({
							type: 0,
							skin: 'layui-layer-demo', //样式类名
							title: "操作成功",
							closeBtn: 0, //不显示关闭按钮
							anim: 2,
							maxWidth: '50%',
							maxHeight: '50%',
							shadeClose: false, //开启遮罩关闭
							content: '<div style="max-width:100%">' +
								'<li style="text-align:center;" class="layer-area">' +
								'<div style="text-align:center;">' +
								'<img  draggable="false" style="max-Width:70%;max-height:60%;" src="https://i0.hdslb.com/bfs/album/481b5ceef0d56aa329652b269f5a02f447503e7b.png">' +
								'<div style="text-align:center;">' +
								'<font>操作成功</font>' +
								'</div>' +
								'</div>' +
								'</li>' +
								'</div>',
							btn: ['确认',] //可以无限个按钮
							,
							btn1: function (index, layero) {
								window.location.reload();
							}
						});
					} else {
						layer.open({
							type: 0,
							skin: 'layui-layer-demo', //样式类名
							title: "发生意外错误",
							closeBtn: 0, //不显示关闭按钮
							anim: 2,
							maxWidth: '50%',
							maxHeight: '50%',
							area: ['25%', '60%'],
							shadeClose: false, //开启遮罩关闭
							content: '<div style="max-width:100%">' +
								'<li style="text-align:center;" class="layer-area">' +
								'<div style="text-align:center;">' +
								'<img  draggable="false" style="max-Width:70%;max-height:60%;" src="https://i0.hdslb.com/bfs/album/89f61ba7b2456dfd5af4bd92b485553274f73ad4.png">' +
								'<div style="text-align:center;">' +
								'<font>' + response.error + '</font>' +
								'</div>' +
								'</div>' +
								'</li>' +
								'</div>',
							btn: ['确认',] //可以无限个按钮
							,
							btn1: function (index, layero) {
								window.location.reload();
							}
						});
					}
				}
			});
		})
		$(document).on("click", "button.button-enter-delete-class", function () { //删除漫画
			var title = $(this).parent().parent().parent().attr('data-title');
			var class_id = $(this).parent().parent().parent().attr('data-class-id');
			var id = $(this).parent().parent().parent().attr('data-id');
			var me = $(this);
			$.ajax({
				type: "post",
				url: controller + "Classified/enterDeleteClass?class_id=" + class_id,
				data: {
					"title": title,
					"id": id,
					"token": token,
				},
				dataType: "json",
				success: function (response) {
					if (response.code == 200) {
						layer.open({
							type: 0,
							skin: 'layui-layer-demo', //样式类名
							title: "操作成功",
							closeBtn: 0, //不显示关闭按钮
							anim: 2,
							maxWidth: '50%',
							maxHeight: '50%',
							shadeClose: false, //开启遮罩关闭
							content: '<div style="max-width:100%">' +
								'<li style="text-align:center;" class="layer-area">' +
								'<div style="text-align:center;">' +
								'<img  draggable="false" style="max-Width:70%;max-height:60%;" src="https://i0.hdslb.com/bfs/album/481b5ceef0d56aa329652b269f5a02f447503e7b.png">' +
								'<div style="text-align:center;">' +
								'<font>操作成功</font>' +
								'</div>' +
								'</div>' +
								'</li>' +
								'</div>',
							btn: ['确认',] //可以无限个按钮
							,
							btn1: function (index, layero) {
								window.location.reload();
							}
						});
					} else {
						layer.open({
							type: 0,
							skin: 'layui-layer-demo', //样式类名
							title: "发生意外错误",
							closeBtn: 0, //不显示关闭按钮
							anim: 2,
							maxWidth: '50%',
							maxHeight: '50%',
							area: ['25%', '60%'],
							shadeClose: false, //开启遮罩关闭
							content: '<div style="max-width:100%">' +
								'<li style="text-align:center;" class="layer-area">' +
								'<div style="text-align:center;">' +
								'<img  draggable="false" style="max-Width:70%;max-height:60%;" src="https://i0.hdslb.com/bfs/album/89f61ba7b2456dfd5af4bd92b485553274f73ad4.png">' +
								'<div style="text-align:center;">' +
								'<font>' + response.msg + '</font>' +
								'</div>' +
								'</div>' +
								'</li>' +
								'</div>',
							btn: ['确认',] //可以无限个按钮
							,
							btn1: function (index, layero) {
								window.location.reload();
							}
						});
					}
				}
			});
		})
		$(document).keydown(function (event) {
			// console.log(event.keyCode);

			if (event.altKey && (event.keyCode == 37 || event.keyCode == 39)) {
				event.returnValue = false;
				return false;
			} else if (event.keyCode == 116) { ////屏蔽F5刷新键   
				return false;
			} else if (event.keyCode == 16 && event.altKey) { //shift+ait 创建分类
				layer.open({
					type: 2,
					skin: 'layui-layer-demo', //样式类名
					title: "创建分类",
					closeBtn: 0, //不显示关闭按钮
					anim: 2,
					maxWidth: '50%',
					maxHeight: '50%',
					area: ['45%', '60%'],
					shadeClose: false, //开启遮罩关闭
					content: controller + 'Classified/EditClassified?token=' + encodeURIComponent(token),
					btn: ['确认', '取消'], //可以无限个按钮
					btn1: function (index, layero) {
						var body = layer.getChildFrame('body', index);
						body.contents().find('button.button-save-changes').click();
						// layer.close(index); //再执行关闭 
					},
					btn2: function (index, layero) {
						layer.close(index); //再执行关闭 
					}
				})
			}


		})
	</script>
</body>

</html>